import cn.bdqn.dao.StudentDao;
import cn.bdqn.entity.Student;

import java.sql.*;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        ///
        System.out.println("请输入学号：");
        Scanner input = new Scanner(System.in);
        String username=input.next();
        System.out.println("请输入密码：");
        String password=input.next();

        Student student=new StudentDao().login(username,password);

        if (student==null){
            System.out.println("学号或密码错误");
        }else {
            System.out.println("登录成功");
        }

        
        ///
        System.out.println("请输入你要查询学号的学生名字：");
        String na=input.next();
        String studentNo=new StudentDao().getNobyNane(na);
        if (studentNo==null){
            System.out.println("不存在此学生");
        }else {
            System.out.println(studentNo);
        }

    }
}
